package com.njbdqn.myhouse.composes.page;

public class PageInparam {
	private int pageSize = 10;
	private int currentPage = 1;
	private String conds="";
	private String sqlCond= "";
	public int getPageSize() {
		return pageSize;
	}
	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}
	public int getCurrentPage() {
		return currentPage;
	}
	public void setCurrentPage(int currentPage) {
		this.currentPage = currentPage;
	}
	public String getConds() {
		return conds;
	}
	public void setConds(String conds) {
		this.conds = conds;
		this.sqlCond = "";
		String[] str = conds.split(";");
		ContextCondition ctx = new ContextCondition();
		for (String s : str) {
			sqlCond += " and "+ctx.getQueryCondition(s);
		}
		sqlCond = sqlCond.replaceFirst("and", "");
	}
	public String getSqlCond() {
		return sqlCond;
	}
	public static void main(String[] args) {
		PageInparam pip = new PageInparam();
		pip.setConds("{name:name;1:1}");
		System.out.println(pip.getSqlCond());
	}
}
